/**
 * 
 */
package edu.wpi.cs509.messages.server;

import edu.wpi.cs509.messages.MsgBc;
import edu.wpi.cs509.messages.client.MsgGetGamesReply;

/**
 * This class implements the get games message from 
 * the client to the server.
 * @author sparadis
 *
 */
public class MsgGetGames extends MsgServerContext {

	/**
	 * serializable version number
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * Constructor.
	 */
	public MsgGetGames() {
	}

	/**
	 * Get the list of joinable games
	 * @return MsgBc - a message with the list of joinable games.
	 */
	public MsgBc doExecuteAndGetReply() {
		//Get the list of joinable games, make a reply message.
		return (new MsgGetGamesReply(getServer().getJoinableGames()));
	}
}
